/**
 *
 */
package com.naiterui.ehp.bs.doctor.repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.PatientGroup;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

@Repository
public interface IPatientGroupRepository extends BaseJpaRepository<PatientGroup, Long> {

    List<PatientGroup> findByDoctorIdOrderByCreatedAtDesc(Long doctorId);

    long countByDoctorIdAndName(Long doctorId, String groupName);

    /**
     * 批量查询患者分组名称
     * @Author YongYang
     * @Date 2017年3月2日
     * @since 1.0.0
     * @return
     */
    List<PatientGroup> findByIdInOrderByCreatedAtDesc(Collection<Long> ids);



    long countByIdIn(Collection<Long> groupIds);
}
